package com.muyan.observable.impl;

import com.muyan.observable.MessageObServable;

import java.util.Observable;

/**
 * @Author: YLTDMenglc
 * @Date: 2019/6/11
 * @Time: 12:32
 * @Description:
 */
public class TestJdkObServer {

    public static void main(String[] args) {
        // 1.创建具体的主题
        Observable observable = new MessageObServable();
        // 2. 注册观察者
        observable.addObserver(new SmsObServer());
        observable.addObserver(new WechatObServer());
        observable.addObserver(new EmailObServer());
        // 3.群发消息
        observable.notifyObservers("恭喜以1399元购买蚂蚁课堂永久会员一份");
    }

}
